<?php
    /**
     * Created by PhpStorm.
     * User: huangzhongwei
     * Date: 2018/11/7
     * Time: 9:11
     */

    namespace app\api\behavior;
    use think\Response;

    class CORS
    {
        //    解决跨域
//        public function appInit(&$params)
//        {
////            header('Access-Control-Allow-Origin: *');
////            header("Access-Control-Allow-Headers: token,Origin, X-Requested-With, Content-Type, Accept");
////            header('Access-Control-Allow-Methods: POST,GET');
//            header('Access-Control-Allow-Origin: *');
//            header('Access-Control-Allow-Headers: Token,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
//            header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE,OPTIONS');
//            header('Access-Control-Max-Age: 1728000');
//
//            if(request()->isOptions()){
//
//                exit();
//            }
//        }

    }